﻿using MiniCap.Storage;

namespace MiniCap.Abstractions;

public interface IMiniCapPublisher
{
    Task PublishAsync(string topic, object? payload, IDictionary<string, string>? headers = null, CancellationToken ct = default);


    /// <summary>
    /// 在已有的 MySql 连接和事务内发布（用于业务侧手动控制事务）。
    /// </summary>
    Task PublishAsync(MySqlConnector.MySqlConnection conn, MySqlConnector.MySqlTransaction tran,
    string topic, object? payload, IDictionary<string, string>? headers = null, CancellationToken ct = default);
}

